<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 监听页面是否加载完成 加载完成后再执行 入口函数
       window.onload = function(){
        console.log(document.querySelector('div'));
       }
       
    </script>
</head>
<body>
    <div>哈哈哈</div>
    <p>哈哈哈哈</p>
    <img src="https://img13.360buyimg.com/n5/s720x720_jfs/t1/350658/6/20365/122167/69032f21F233e211c/facf8296ce748477.jpg.avif" alt="">
</body>
</html>